Route GeckoTerminal via pricing-proxy#34
Merged
Conversation
Mirrors the COINGECKO_BASE_URL plumbing already in place: the GeckoTerminal upstream URL becomes a config-driven base path rather than a hardcoded api.geckoterminal.com literal. Defaults to the public host so existing deployments without the env var keep working; setting GECKOTERMINAL_BASE_URL points the service at the in-cluster pricing-proxy on https://github.com/DFXswiss/pricing-proxy, which adds a 60 s shared cache, request coalescing and validation on top of the shared free-tier 30 req/min IP quota. With three monitoring stacks on the same host (d-EURO, jdt, jdm) all hitting GT directly, the shared anonymous IP quota burns out under load and restart-bursts. Behind the proxy, the three streams collapse to one upstream call per 60 s. Non-breaking: the literal default keeps every existing deployment on the direct path until its compose adds GECKOTERMINAL_BASE_URL.
Hard-fail at construction when GECKOTERMINAL_BASE_URL is unset, mirroring the existing COINGECKO_BASE_URL check in the same constructor. The previous `?? 'https://api.geckoterminal.com'` default silently fell back to the public host — the exact pattern the CoinGecko refactor was meant to remove for that route. Treating both upstreams the same way removes a class of silent anonymous fallbacks that surface later as sporadic 429s once the shared host quota is exhausted. `.env.example` upgraded from optional comment to required entry, again matching the COINGECKO_BASE_URL phrasing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the required `GECKOTERMINAL_BASE_URL` env var to point the GeckoTerminal upstream at the in-cluster pricing-proxy (DFXswiss/pricing-proxy) instead of `api.geckoterminal.com` directly. Mirrors the `COINGECKO_BASE_URL` plumbing already in this repo — same construction-time hard-fail, same .env wording, same getter shape.
Why
GeckoTerminal's free tier shares a single 30 req/min IP quota across every consumer on the host. With three monitoring stacks on each host (d-EURO + jdt + jdm) plus restart-bursts, that quota burns out and surfaces as 429s — the same failure mode the CoinGecko route already removes.
The pricing-proxy now exposes a `/geckoterminal/` route (pricing-proxy#3) with the same 60 s shared cache, request coalescing and validation pipeline already in front of CoinGecko Pro. Pointing this service at it collapses the three independent streams into one upstream call per 60 s.
What changes
Breaking — rollout order matters
`GECKOTERMINAL_BASE_URL` is required. A container started without it now refuses to construct and the deploy will roll back. The server-side compose update on `DFXswiss/server` (adding the env to `jdt-monitoring` + `jdm-monitoring` on dfxdev + dfxprd) must therefore be in place before the Auto-Release-PR for this repo lands on `main` and the `:latest` image rebuilds.
Recommended order:
Test plan